package com.hubu.controller;

import com.hubu.pojo.Commodity;
import com.hubu.service.CommodityService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;

@Controller
@RequestMapping("/edit")
public class EditSubmitController {
    @Resource
    private CommodityService commodityService;

    @PostMapping("/submit")
    public String comEditSubmit(Commodity commodity) {
        commodityService.editComById(commodity);
        return "redirect:/commodity";
    }
}
